﻿    using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BLL;
using DAL;
using IDAL;
using Model;

namespace Flowers.Controllers
{
    public class StaffController : Controller
    {
        //
        // GET: /Staff/
        BLL.IFactory<IStaffDAL, StaffDAL> bll = new Factory<IStaffDAL, StaffDAL>();


        public ActionResult StaffIndex()
        {
            return View();
        }

        /// <summary>
        /// 显示数据
        /// </summary>
        /// <returns></returns>
        public ActionResult StaffIndexs()
        {
            return Json(bll.Fbll().StaffShow());
        }
        /// <summary>
        /// 停用状态
        /// </summary>
        /// <returns></returns>
        public int StaffDel()
        {
            int id = Convert.ToInt32(Request["UserID"]);
            if (bll.Fbll().StaffDel(id) > 0)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }


        public int StaffFull()
        {
            int id = Convert.ToInt32(Request["UserID"]);
            if (bll.Fbll().StaffUpt(id) > 0)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }


        public int StaffAdd(StaffModel mo)
        {
            if (bll.Fbll().StaffAdd(mo) > 0)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }

    }
}
